ne=""

# 遍历/etc目录下的普通文件
for file in /home/wjc/work1/etc/*; do
  if [ -f "$file" ]; then
    current_length=$(awk '{ if (length > max) { max = length; longest_line = $0 } } END { print length(longest_line), longest_line }' "$file")
    if [ $current_length -gt $max_length ]; then
      max_length=$current_length
      max_line=$(awk '{ if (length > max) { max = length; longest_line = $0 } } END { print longest_line }' "$file")
    fi
  fi
done

echo "最长的一行内容为：$max_line"
echo "长度为：$max_length"

